package com.example.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

//@Controller
//@ResponseBody
@RestController    //两个注解合二为一   @Controller   @ResponseBody
public class TestController {

    @RequestMapping("/sayhi")  //页面默认返回静态页面
    public String sayHi() {
        return "hello.html";   //返回试图
    }
}
